/*	Copyright (c) 2010 MIEM (http://miem.edu.ru/)
 *
 *	Authors:
 *		* Andrey Shtykovskiy    ( ashty@itas.miem.edu.ru      )
 *		* Edward Klyshinsky     ( klyshinsky@itas.miem.edu.ru )
 *		* Sergey R. Tumkovsky   ( srt@itas.miem.edu.ru        )
 *
 *	This file is part of MOAN (morphology analysis) software.
 *
 *	MOAN is free software: you can redistribute it and/or modify it 
 *	under the terms of the GNU General Public License as published 
 *	by the Free Software Foundation, either version 3 of the License, 
 *	or (at your option) any later version.
 *
 *	This library is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *	Lesser General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License 
 *	along with MOAN. If not, see http://www.gnu.org/licenses/.
 */

#ifndef __PART_OF_SPEECH_HPP_GUARD__
#define __PART_OF_SPEECH_HPP_GUARD__

#include <algorithm>
#include <string>
#include <list>

namespace moan {

	template< 
		typename category_t /*,
		typename extractor_t */
			>
	class part_of_speech {

	public:
		typedef category_t category_type;
		typedef std::list<category_type> category_collection_type;
		typename typedef category_collection_type::const_iterator category_const_iterator;

		/* === this should be out  === */

		explicit part_of_speech(const char* name_) {
			_name.assign(name_);
		}

		const char* name() const {
			return _name.c_str();
		}

		/* === end of section === */

		void add_category(const category_type& category_) {
			_categories.push_back(category_);
		}

		size_t category_count() const {
			return 1;
		}

		const category_type* get(const char* name_) const {
			
			for(category_const_iterator it = _categories.begin();
				it != _categories.end(); ++it						) {
					if( 0 == strcmp(name_, it->name()) ) {
						return &(*it);
					}
			}

			return NULL;
		}

	private:
		
		std::string _name;
		category_collection_type _categories;

	}; /* class part_of_speech */

} /* namespace moan */

#endif /* __PART_OF_SPEECH_HPP_GUARD__ */